package class1.s2022350143028.model;

import base.model.OrdersBaseModel;

/**
 * 订单模型
 *
 * @author Kcjuly
 * @date 2024-04-25
 * <p>
 * 属性：订单编号、订单时间、客户名称、商品编号、商品名称、单价、数量, 合计价格
 * 字段： orderId、orderTime、clientName、goodsId、goodsName、price、quantity
 */

public class OrdersModel extends OrdersBaseModel {
    //已有属性
//    protected String orderId;
//    protected LocalDateTime orderTime;
    public String clientName;
    public String goodsId;
    public String goodsName;
    public int price;
    public int quantity;

    public void setClientName(String clientname){this.clientName=clientname;}

    public void setGoodsId(String goodsid){this.goodsId=goodsid;}

    public void setGoodsName(String goodsname){this.goodsName=goodsname;}

    public void setPrice(int price){this.price=price;}

    public void setQuantity(int quantity){this.quantity=quantity;}

//    public void setOrderTime(LocalDateTime orderTime) {this.orderTime = orderTime;}
//    public void setOrderId(String orderId) {this.orderId = orderId;}

//    public void setoderId(){//系统随机生成随机订单编号
//        String head="S";
//        Random rand =new Random();
//        int number = rand.nextInt(9000) + 1000;
//        String s=String.valueOf(number);
//        orderId=head+s;
//    }

//  public void setOrderId(String orderId) {this.orderId = orderId;}
    public String getClientName(){return clientName;}

    public String getgoodsId(){return goodsId;}

    public String getgoodsName(){return goodsName;}

    public int getprice(){return price;}

    public int getQuantity(){return quantity;}

    public double getTotalPrice(){
        return price*quantity;
    }

//
//    public String getOrderId() {
//        return orderId;
//    }
//

//
//    public LocalDateTime getOrderTime() {
//        return orderTime;
//    }
//



    //todo 其余属性字段，需要继承完善
}
